/*
 * ReadClientRequestTask.hpp
 *
 *  Created on: 03.12.2012
 *      Author: zheka
 */

#ifndef READCLIENTREQUESTTASK_HPP_
#define READCLIENTREQUESTTASK_HPP_

#include "Task.hpp"
#include <string>
#include "http/HttpRequestParser.hpp"
#include "proxy/CacheEntry.hpp"
class ReadClientRequest: public Task {
public:
	ReadClientRequest(int fileDescriptor);
	virtual void onInit(Context & context);
	virtual void onRead(Context & context);
	virtual void onWrite(Context & context);
	virtual std::string toString();
private:
	std::string data;
	HttpRequestParser parser;
	CacheEntry * cacheEntry;
	size_t written;
	HttpRequest request;

};

#endif /* READCLIENTREQUESTTASK_HPP_ */
